package com.zhiyou100.abstract_demo1;

public class Test {

    public static void main(String[] args) {
        Master master = new Master();
        //利用多态，父类引用变量执行子类类型的对象
        Pet pet = new Dog();
        pet.setName("大黄");
        master.feed(pet);
        pet = new Cat();
        master.feed(pet);

    }


}
